<?php
namespace Core\CoreContracts;

/*
* Article class definition
*/
class Article 
{
	/**
    * @property integer $Id The article unique identifier
    */
	public $Id;
	
	/**
    * @property string $Title The article title
    */
	public $Title;
	
	/**
    * @property string $Text The article text
    */
	public $Text;

	/**
    * @property integer $State The article state ('Offline', 'Edit', 'Online', 'Archive')
    */
	public $State;
	
	/**
    * @property datetime $ModificationDate The article modification date
    */
	public $ModificationDate;
	
	/**
    * @property datetime $ModificationDate The article creation date
    */
	public $CreationDate;
	
	/**
	* The default constructor
	*/
	public function __construct()  {  }
	
	/*
	* Build a new article object
	*
	* @param string $title The article title 
	* @param string $text The article text
	*/
	public static function Create($title, $text)
	{
		$article = new Article();
		$category->Title = $title;
		$category->Text = $text;
		$category->State = 0;	
		$category->ModificationDate = date("Y-m-d H:i:s");
		$category->CreationDate = date("Y-m-d H:i:s");
		return $category ;
	}
}
?> 